<?php
namespace Admin\Model;
use Think\Model\RelationModel;
class GoodsModel extends RelationModel{
	//protected $tableName='goods';
	//定义关联
	protected $_link = array(
			'Category'=>array(
			   	'mapping_type'=>self::BELONGS_TO,	
				'mapping_name'=>'cate',	//定义关联映射名称
				'mapping_fields'=>'name,cid', //需要查询的字段
				'class_name'=>'Category',
				'foreign_key'=>'cid'		
	      ),
	);
}
